1. Technical Field
The present invention relates to the field of information handling systems and in particular to an improved data processing system for storing information for output. Still more particularly, the present invention relates to a method and apparatus for increasing printing speed while reducing processing time, memory requirements and the spool file size.
2. Description of Related Art
An application prints an image by first preparing the image and locating or placing it on a page to be printed. However, the printer may not be available for immediately printing the image or the image may be sent to a remote printer that the operating system does not control. Therefore, the bitmap image is spooled into a metafile with other images and text is positioned on the page to be printed. Before spooling the bitmap image, the generic graphics environment program interface (GEPI) compresses the bitmap using an arbitrary compression format such as a run-length-encoding algorithm, thereby reducing the file size of the bitmap. No consideration is made as to which format is going to be used by the printer. When the printer is available to print the bitmap, memory must be allocated for decompressing the bitmap into a device independent format. The generic graphics environment program interface must again be called, this time to decompress the bitmap using the same arbitrary compression format used to compress the bitmap into the allocated memory. The bitmap must again be compressed using another compression format, a format that is supported by the printer. The compressed bitmap is then sent to the printer for printing.
The above described process requires the image to be compressed twice, using separate compression formats. Additionally the above described process requires that a number of calls be placed between the application or generic graphics environment program interface and the printer driver in order to compress and decompress the image for the metafile.
Further, the compression algorithm used by the generic graphics environment program interface is arbitrarily selected. Also, additional memory must be allocated for decompressing the bitmap. Even further, more network traffic is required because the spool file is larger.
The present invention provides a method and apparatus in a data processing system for storing bitmap images. Data received from memory includes bitmap images for output on an output device, wherein the images are stored in compressed or uncompressed form. The operating system, application, or generic graphics environment program interface queries the printer driver for the types of image compression formats supported by the printer. If the image is available in a compatible compressed format, that compressed image is read from memory. Alternatively, or in addition, the best possible compression format supported by the printer is selected from the formats available in the printer driver. The image is then loaded in a printer compatible compression format or compressed using the selected format. The image is spooled in the selected compression format. The image file may be spooled as a raw file or metafile depending on the embodiment used. When needed by the printer or video display, the spool file containing the compressed image is accessed from storage, and the compressed image is sent directly to the printer or video display without allocating memory for decompressing the bitmap image or decompressing the image.